#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    button = new QPushButton(this);
    button->setText("按钮");
    button->move(100,100);
    connect(button,&QPushButton::clicked,this,&Widget::handleClicked);
}

Widget::~Widget()
{
    delete ui;
}

//自定义槽函数的定义
void Widget::handleClicked()
{
    //按下按钮就修改窗口标题
    this->setWindowTitle("按钮已经按下！");
}

